import Vue from "vue"
import Vuex from "vuex"

import actions from "./action"
import mutations from "./mutations"
import getters from "./getters"
import state from "./initState"

Vue.use(Vuex)

export default function () {
    const store = new Vuex.Store({ //注意导出的是一个对象，每次调用的时候都是同一个实例
        actions,
        mutations,
        getters,
        state
    }) 
     return store;
}